package Memento_Pattern.RPG;

// -*-coding:utf-8 -*-
//人员：刘陆鑫
//班级：19软3
//学号；2019110218
public class Player {
    private int num;
    public Player(int num){
        this.num=num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getNum() {
        return num;
    }
    public PlayerMemento save(){
        return new PlayerMemento(this.num);
    }
    public void restore(PlayerMemento memento){
        this.num=memento.getNum();
    }
}
